<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 循环数组，点击消失 -->
    <div id="app">
        
        <p @click="dian(index)" v-for="(item, index) in zzz" :key="index">{{ item }}</p>
    </div>
</body>
<script src="./vue.js"></script>
<script>
    const{ createApp,ref}=Vue

    createApp({
    setup() {
        const zzz = ref(['1', '2', '3', '4', '5', '6']);
        function dian(index){
            zzz.value.splice(index,1);

        }

        return {
            zzz,
            dian

        }
    }
    }).mount('#app');

</script>

</html>